package com.qf.demo1.controller;

import com.qf.demo1.service.CmdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/cmd")
public class CmdController {

    @Autowired
    private CmdService cmdService;

    @GetMapping("/send")
    public String send(){
        //这些信息都应该从前端传递过来
        String topic = "java2303/abc";
        Integer qos = 1;
        String payload = "{\"air\":\"优\"}";

        cmdService.send(topic,qos,payload);

        return "success...";
    }
}
